
package Project;

import Project.bussiness.Patient;
import java.util.Vector;

/**
 *
 * @author haolt_c0708l
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
   
        public static boolean checkDateInputOutput(String in,String out)
    {
            boolean flag=true;        
            String dd,mm,yyyy;
            int d1=0,m1=0,y1=0;
            mm=in.substring(0,2);
            dd=in.substring(3,5);
            yyyy=in.substring(6,10);
            try{
            m1=Integer.parseInt(mm);
            d1=Integer.parseInt(dd);
            y1=Integer.parseInt(yyyy);
            }catch(Exception e){flag=false;}
            int d2=0,m2=0,y2=0;
            mm=out.substring(0,2);
            dd=out.substring(3,5);
            yyyy=out.substring(6,10);
            try{
            m2=Integer.parseInt(mm);
            d2=Integer.parseInt(dd);
            y2=Integer.parseInt(yyyy);
            }catch(Exception e){flag=false;}     
            if (y1>y2) flag= false;
            else 
                if (y1==y1)
                {
                    if(m1>m2) flag= false;
                    else if (m1==m2)
                    {
                        if (d1>d2) flag=false;
                    }
                }
        return flag;
    }
         /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
    {
        Vector v=new Vector();
        try{
        DBHelper con=new DBHelper();
        v=Patient.getAllPatient();
        }catch(Exception e){e.printStackTrace();}
        for(Object obj:v) {
        Patient p=(Patient)obj;   
        System.out.println(p.getPatientID());
        System.out.println(p.getFirstName());
         }
//   System.out.println(checkDateInputOutput("04/08/2001","08/08/2001"));
}
}
